<?php
class Admin_Form_Area extends Zend_Form
{
    public function init()
    {
        $this->setName("admin");

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');
        
        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Tên khu vực (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
        $name->setAttrib('size', 60);
        
        $ord = new Zend_Form_Element_Text('ord');
        $ord->setLabel('Thứ tự')->addFilter('StripTags')->addFilter('StringTrim')->addFilter('Int');
        $ord->setAttrib('size', 10);
        
        $display = new Zend_Form_Element_Checkbox('display');
        $display->setLabel('Hiển thị');                        

        // submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id','submitbutton');
        $submit->setAttrib('class',"button medium");
                
        // add elements to form
        $this->addElements(array (
            $id, $name, $ord, $display, $submit
        ));
    }
}

